package com.googlecode.activitiportal.bpm;

import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

public class PortalAssignmentHandler implements TaskListener {

  private static final long serialVersionUID = 7652257312713631321L;

	@Override
	 public void notify(DelegateTask delegateTask) {
		
		String taskName = delegateTask.getName();
		
		if ("PlanejarExecucao".equalsIgnoreCase(taskName)){
			delegateTask.setAssignee("user2");
		} else if ("AprovarPlanejamento".equalsIgnoreCase(taskName)){
			delegateTask.setAssignee("user2");
		} else if ("ReceberPecas".equalsIgnoreCase(taskName)){
			delegateTask.setAssignee("user2");
		} else if ("FotografarPecas".equalsIgnoreCase(taskName)){
			delegateTask.setAssignee("user2");
		} else if ("TratarImagens".equalsIgnoreCase(taskName)){
			delegateTask.setAssignee("user2");
		} else if ("DiagramarTags".equalsIgnoreCase(taskName)){
			delegateTask.setAssignee("user2");
		} else if ("EncerrarOrdemServico".equalsIgnoreCase(taskName)){
			delegateTask.setAssignee("user2");
		} else if ("EnviarPecas".equalsIgnoreCase(taskName)){
			delegateTask.setAssignee("user2");
		}
		
  }

}
